package thread;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.TimeUnit;

public class TwoRunnable {
    public static void main(String[] args) {
        AA aa =new AA();
        aa.run();
        aa.run();
    }
}

class AA implements Runnable{

    @Override
    public void run() {
        while (true) {
            System.out.println(Thread.currentThread().getName() + ":" + LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME));
            try {
                TimeUnit.SECONDS.sleep(5);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
